<extend name="Layout/ins_popup" />
<block name="content">
	<input type="hidden" name="ajax" id="ajax" value="1">

	{:W('PageHeader/popup',array('name'=>'添加'))}
	<div class="row">
		<div class="col-sm-12">
			<form method='post' id="form_data" class="well form-horizontal">
				<input type="hidden" name="controller" id="controller" value="{$controller}">
				<input type="hidden" name="row_type" id="row_type" value="{$row_type}">
				
				<input type="hidden" id="opmode" name="opmode" value="add">
				<input type="hidden" name="ajax" id="ajax" value="1">

				<div class="form-group">
					<label class="col-xs-3 control-label" for="name">名称*：</label>
					<div class="col-xs-9">
						<input class="form-control" type="text" id="name" name="name" check="require" msg="请输入名称">
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-3 control-label" for="type">控件类型*：</label>
					<div class="col-xs-9">
						<select name="type" id="type" check="require" msg="请选择控件类型" class="form-control col-12">
							<option value="">请选择</option>
							<option value="text">单行文本</option>
							<option value="date">日期 </option>
							<option value="datetime">日期+时间 </option>
							<option value="select">列表</option>
							<option value="link_select">联动列表</option>
							<option value="radio">单选</option>
							<option value="checkbox">多选 </option>
							<option value="textarea">多行文本 </option>
							<option value="editor">编辑器</option>
							<option value="simple">简易编辑器</option>
							<option value="help">帮助 </option>
							<option value="hr">分隔符</option>
						</select>
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-3 control-label" for="layout">控件布局：</label>
					<div class="col-xs-9">
						<select name="layout" id="layout" check="require" msg="请选择控件布局" class="form-control col-12">
							<option value="">请选择 <option value="1">两列 <option value="2">整行 <option value="3">帮助 <option value="4">分隔符
						</select>
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-3 control-label" for="data">控件数据：</label>
					<div class="col-xs-9">
						<input  class="form-control" type="text" id="data" name="data" >
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-3 control-label" for="config">设置：</label>
					<div class="col-xs-9">
						<input  class="form-control" type="text" id="config" name="config" >
					</div>
				</div>
				<div class="form-group =">
					<label class="col-xs-3 control-label" for="sort">排序：</label>
					<div class="col-xs-9">
						<input class="form-control" type="text" id="sort" name="sort" >
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-3 control-label" for="validate">验证：</label>
					<div class="col-xs-9">
						<select name="validate" id="validate" class="form-control col-12">
							<option value="">请选择 <option value="require">必选 <option value="email">邮件 <option value="number">数字
						</select>
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-3 control-label" for="msg">错误提示：</label>
					<div class="col-xs-9">
						<input  class="form-control" type="text" id="msg" name="msg" >
					</div>
				</div>
			</form>
		</div>
	</div>
</block>
<block name="js">
	<script type="text/javascript">

		function save() {
			if (check_form("form_data")) {
				var vars = $("#form_data").serialize();
				sendAjax("{:U('save')}", vars, function(data) {
					if (data.status) {
						ui_alert(data.info, function() {
							parent.location.reload(true);
							myclose();
						});
					}else{
						ui_error(data.info);
					}
				});
			}

		}

		
	</script>
</block>